package com.education.online.service.impl;


import com.education.common.utils.Convert;
import com.education.online.mapper.OPrepaResourcesMapper;
import com.education.online.pojo.OPrepaResources;
import com.education.online.service.OPrepaResourcesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 备课共享资源表 服务层实现
 *
 * @author d
 * @date 2020-06-04 15:17:49
 */
@Service
public class OPrepaResourcesServiceImpl implements OPrepaResourcesService {

    @Autowired
    private OPrepaResourcesMapper oPrepaResourcesMapper;

    @Override
    public List<OPrepaResources> selectOPrepaResourcesByUserId(Integer userId) {
        return oPrepaResourcesMapper.selectOPrepaResourcesByUserId(userId);
    }

    @Override
    public List<OPrepaResources> selectOPrepaResourcesByPrepaIdAndTypeId(Integer prepaId, Integer typeId) {
        return oPrepaResourcesMapper.selectOPrepaResourcesByPrepaIdAndTypeId(prepaId,typeId);
    }

    @Override
    public Integer selectCount(Integer userId) {
        return oPrepaResourcesMapper.selectCount(userId);
    }

    @Override
    public List<OPrepaResources> selectOPrepaResourcesByName(String name) {
        return oPrepaResourcesMapper.selectOPrepaResourcesByName(name);
    }

    //查询备课共享资源表信息
    @Override
    public OPrepaResources selectOPrepaResourcesById(Integer id) {
        return oPrepaResourcesMapper.selectOPrepaResourcesById(id);
    }

    // 查询备课共享资源表列表
    @Override
    public List<OPrepaResources> selectOPrepaResourcesList(OPrepaResources oPrepaResources) {
        return oPrepaResourcesMapper.selectOPrepaResourcesList(oPrepaResources);
    }

    // 新增备课共享资源表
    @Override
    public int insertOPrepaResources(OPrepaResources oPrepaResources) {
        return oPrepaResourcesMapper.insertOPrepaResources(oPrepaResources);
    }

    //修改备课共享资源表
    @Override
    public int updateOPrepaResources(OPrepaResources oPrepaResources) {
        return oPrepaResourcesMapper.updateOPrepaResources(oPrepaResources);
    }

    //删除备课共享资源表对象
    @Override
    public int deleteOPrepaResourcesByIds(String ids) {
        return oPrepaResourcesMapper.deleteOPrepaResourcesByIds(Convert.toStrArray(ids));
    }
}